package ui;

import dominio.Jugador;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.CompoundPropertyModel;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function0;
import org.uqbar.wicket.xtend.WicketExtensionFactoryMethods;
import org.uqbar.wicket.xtend.XForm;

@SuppressWarnings("all")
public class PrincipalPage extends WebPage {
  @Extension
  private WicketExtensionFactoryMethods _wicketExtensionFactoryMethods = new Function0<WicketExtensionFactoryMethods>() {
    public WicketExtensionFactoryMethods apply() {
      WicketExtensionFactoryMethods _wicketExtensionFactoryMethods = new WicketExtensionFactoryMethods();
      return _wicketExtensionFactoryMethods;
    }
  }.apply();
  
  private Jugador jugador;
  
  public PrincipalPage() {
    Jugador _jugador = new Jugador();
    this.jugador = _jugador;
    CompoundPropertyModel _compoundPropertyModel = new CompoundPropertyModel(this.jugador);
    XForm<Jugador> _xForm = new XForm<Jugador>("jugadorForm", _compoundPropertyModel);
    final XForm<Jugador> form = _xForm;
    this._wicketExtensionFactoryMethods.addChild(this, form);
    this.addFields(form);
  }
  
  public MarkupContainer addFields(final XForm<Jugador> form) {
    MarkupContainer _xblockexpression = null;
    {
      TextField _textField = new TextField("nombre");
      final TextField nombreField = _textField;
      this._wicketExtensionFactoryMethods.addChild(form, nombreField);
      Label _label = new Label("dinero");
      MarkupContainer _addChild = this._wicketExtensionFactoryMethods.addChild(form, _label);
      _xblockexpression = (_addChild);
    }
    return _xblockexpression;
  }
}
